/*
 * Function.h
 *
 *  Created on: 2013. 9. 12.
 *      Author: jjaehuny
 */

#ifndef PROJECTZ_NLOGIC_FUNCTION_H_
#define PROJECTZ_NLOGIC_FUNCTION_H_

#include "../Enum.h"
#include <time.h>
#include <string>
#include "MailBox.h"

namespace ProjectZ {
class User;
} /*ProjectZ*/

namespace ProjectZ { namespace NLogic {
class Space;
class Party;
class Item;
} /*NLogic*/ } /*ProjectZ*/

namespace ProjectZ { namespace NLogic { namespace NFunction {

class Function {
public:
	Function();
	virtual ~Function();
};

unsigned int 		GetTickCount();

// Level
void 				SendMyLevelExp(User * pUser, int rewardGold, bool bLevelUp);
int					IncreaseExp(User * pUser, int exp);
int 				getMaxExp(User * pUser);
int 				getIncreaseStat(User * pUser, ESTATNAME statname);
// Level

// VC
bool				VCProcess(User * pUser, int vcIndex, int price=0);
int					GetBagSlotMaxOpenCount(INVEN_BAG_TYPE eBagType);

time_t				GetRecvStaminaInitTime();
time_t				GetNextDailyMissionInitTime();
time_t				GetDailyMissionInitTime();
time_t				GetMonthInitTime();
time_t 				GetHourInitTime(time_t initTime);
time_t				GetWeekInitTime();
time_t				GetNextWeekInitTime();
time_t				GetDailyInitTime(time_t initTime);
int					GetMonsterHP(User * pUser, int level, int mode, int dungeon, int playerCount, bool bLegend, bool bBoss, bool bBattlepet=false);
int					GetAdjustHP(User * pUser, bool bPvP=true);

int 				GetPKSessionRank(int userseq, NLogic::Space *pSpace);

bool 				IsInternalIP(std::string &str);
int					GetDefaultStat(int classType, ESTATNAME statname);
int					GetStatUpConst(int classType, ESTATNAME statname);

//void				kakaoPaymentLogCallback(int httpResult, const char * data);
//void				SendKakaoPaymentLog(User * pUser, int nPrice, int buySeq);
void				SendPush_android(const char * key, const char * uuid);
void				SendPush_ios(const char * key, const char * uuid);

void				SendPush(unsigned int userseq, std::string msg);

void 				SendCPI(const char * pData);

void				SendMyWallet(User * pUser);
void				ModifyGold(User * pUser, int gold);

bool				SendMail(User * pUser, NLogic::MailBox::Mail::Data & data);

int 				GetRank(User * pUser, NLogic::Space * pSpace);

int					GetMaxHP(User * pUser);
int					GetMaxSP(User * pUser);

const char *		ReplaceSingleQuotation(const char * string);

// Character 정보 관련 Function
void				SendCharacterDefaultInfo(User * pFromUser, User * pToUser);
void				SendCharacterEquipInfo(User * pFromUser, User * pToUser);
void				SendCharacterFairyInfo(User * pFromUser, User * pToUser);
void				SendCharacterInvenBagInfo(User * pFromUser, User * pToUser, int bag_type);
void				SendCharacterInfoSimple(User * pFromUser, User * pToUser);
void				SendCharacterDetailInfo(int fromUserSeq, User * pToUser);
void				SendAICharacterDefaultInfo(User * pFromUser, User * pToUser);
void				SendAICharacterEquipInfo(User * pFromUser, User * pToUser);
void				SendAICharacterQuickSlotInfo(User * pFromUser, User * pToUser);
void				SendInvenItemUpdate(User * pUser, Item * item);
void				SendSkillBuff(User * pUser);

void 				SendExceptionNoSpace(User * pUser);
void 				SendExceptionNoParty(User * pUser);

bool				IsRegisterUser(int user_seq);

void				StringSplit(std::string & targetString, char separator, std::vector<std::string> & resultVector);
void				StringToIntSplit(std::string & targetString, char separator, std::vector<int> & resultVector);

bool				IncreaseExpFairy(NLogic::Item * pItem, int exp, int maxLevel);
int 				getMaxExpFairy(NLogic::Item * pItem);

} /*NFunction*/ } /*NLogic*/ } /* namespace ProjectZ */

#endif /* FUNCTION_H_ */
